Support de l'anglais pour l'interface (i18n fr/en) - #66
Merged
Conversation
- Add fr/en interface language (global, stored in localStorage, default from navigator) via a small language context + per-domain string modules. - Localize every screen and component, the static landing in index.html (bilingual via CSS-toggled data-lang spans, no flash), badges, changelog, privacy, strategy hints and feedback messages. - Make voice input language-aware: English spoken-number parser, recognition language tag, and English TTS audio under public/audio/tts/en/. - Add a language switcher in the parent area. - generate-tts.mjs now produces both languages. Specs and user guide stay French for now. https://claude.ai/code/session_01J9j2FSV2ghTMUwgRgusohv
… defs - Single source of truth for the BCP-47 date locale (localeFor/useLocale in lang.ts); removes the en-GB vs en-US drift across screens. - Remove unused pluralize, subscribeLang and the listener machinery. - Memoize badge definitions/map per language instead of rebuilding them on every per-badge call. https://claude.ai/code/session_01J9j2FSV2ghTMUwgRgusohv
The English TTS run hit transient 429s on a few files; the script exited 1, so the workflow's commit step was skipped and all generated files were lost. - Retry generateAudio with exponential backoff on 429/5xx/network errors. - Slightly larger inter-call delay. - Commit step runs with if: always() so successes persist across runs (generation is idempotent — a re-run only fills the missing files). https://claude.ai/code/session_01J9j2FSV2ghTMUwgRgusohv
…metry Each language now lives under audio/tts/<lang>/ (fr, en). Removes the root/fr special case in useTTS audioPath and the generation script. https://claude.ai/code/session_01J9j2FSV2ghTMUwgRgusohv
- Extract makeSpokenNumberParser (src/lib/spokenNumber.ts): the fallback grammar (digit/phrase, equality-marker, trailing-token, safe-prefix) lives once; fr/en parsers now only declare their word tables, normalize tail and markers. Removes the ~120-line KEEP-IN-SYNC duplication. - Add parseEnglishNumber tests mirroring the French suite (the new parser had no coverage). French tests prove the factory preserved behavior. - useSpeechRecognition: keep the cached recognizer's lang in sync so an interface language change actually reaches voice capture. - Route non-React i18n accessors (badges, strategies, changelog) through the documented pickStrings helper instead of open-coding table[getLang()]. https://claude.ai/code/session_01J9j2FSV2ghTMUwgRgusohv
Set VOICE_ID_EN to an English Voxtral voice (overridable via MISTRAL_VOICE_ID_EN) and drop the en/ MP3s that were generated with the French voice, so the workflow regenerates them with the correct voice. https://claude.ai/code/session_01J9j2FSV2ghTMUwgRgusohv
…ace-support-qu6c2i # Conflicts: # index.html # src/lib/changelog.ts
Contributor
|
Preview supprimée (PR fermée). Les URLs ne sont plus accessibles. |
isc
marked this pull request as ready for review
June 15, 2026 12:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objectif
Ajouter le support de l'anglais pour l'interface, en plus du français. Décisions produit retenues en amont :
localStorage(multiplix-lang), défaut = langue du navigateur.Ce que fait cette PR
Infrastructure i18n
src/i18n/lang.ts(contexte,useLang,useStrings, helpers hors-ReactgetLang/pickStrings) +LangProvider(src/i18n/LangProvider.tsx).src/i18n/*.ts), chacun exposant un hookuseXStrings()basé sur une table{ fr, en }typée (l'anglais doit structurellement matcher le français).Interface
index.html) bilingue sans charger de JS : texte dual<span data-lang>togglé par CSS surhtml[lang], langue fixée avant le 1er paint par l'inline script du<head>(zéro flash). Titre/meta description ajustés pour l'anglais.Vocal / audio
src/lib/parseEnglishNumber.ts) + dispatcher par langue (parseSpokenNumber.ts).useSpeechRecognitionreçoit le bon tag BCP-47 (en-US/fr-FR) selon la langue.useTTSrésout l'audio selon la langue : français à la racine depublic/audio/tts/, anglais souspublic/audio/tts/en/(mêmes clés). Cache namespacé par langue.scripts/generate-tts.mjsgénère désormais les deux langues (TTS_LANGSpour restreindre ;MISTRAL_VOICE_ID_ENpour surcharger la voix anglaise).Les MP3 anglais ne sont pas encore générés (génération = API Mistral Voxtral + secret CI). Tant qu'ils manquent, l'anglais fonctionne au clavier ; la lecture vocale est silencieuse (dégradation gracieuse de
useTTS). Lancer le workflowGenerate TTSsur cette branche pour peuplerpublic/audio/tts/en/.Vérifs
tsc -b,eslint,vitest(173 tests) etBASE=/ npm run build: ✅ tous verts.Points laissés volontairement de côté
/specs/) et guide utilisateur (/guide/) restent en français.name« Tablito » conservé (neutre) ; la description reste statique (un manifest ne peut pas être par-utilisateur).en-US/en-GBselon les écrans — à harmoniser si besoin (détail).https://claude.ai/code/session_01J9j2FSV2ghTMUwgRgusohv
Generated by Claude Code